package com.baiku.sanhos.utils.model.util;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.io.*;
@Component
public class ReadInventoryFile {
    /**
     * 读取指定路径模版文件 .xlsx
     */
    @Value("${modelItemInventoryPath}")
    private String MODEL_FILE_PATH;

    /**
     * 读取模版文件
     * @return 输入流
     */
    public BufferedInputStream readModelFile(){
        //获取文件
        InputStream inputStream = getClass().getClassLoader().getResourceAsStream(MODEL_FILE_PATH);
        assert inputStream != null;
        return new BufferedInputStream(inputStream);
    }
}
